/**
 * 过磅明细api
 */

import { basicIp, newHttpService } from "../../../api/http";

//gb-ship-form/dataOver 数据概览
export const getDataOver = (data: { good: string }) => {
    const url = basicIp + "/gb-ship-form/dataOver";
    return newHttpService.getData(url, data);
}

export interface ILoadingReportType {
    carTotalMonth: number;
    carTotalWeek: number;
    carTotalToday: number;
    jzWeightMonth: number;
    jzWeightWeek: number;
    jzWeightToday: number;
}


//gb-ship-form/shipDetail 报表明细
export const postShipDetail = (data: { carColor: string, carNum?: string, currentPage: number, pageSize: number }) => {
    const url = basicIp + "/gb-ship-form/shipDetail";
    return newHttpService.postData(url, data);
}

interface IfileType {
    fileId: number
    fileName: string
    url: string
    fileSize: string
}


export interface IshipDetailType {
    id: number
    carColor: string
    carNum: string
    emptyPictures: IfileType[]
    emptyTime: string
    emptyVideoFile: IfileType[]
    good: string
    jzWeight: number
    modelName: string
    mzWeight: number
    pzWeight: number
    weightPictures: IfileType[]
    weightTime: string
    weightVideoFile: IfileType[]
}

//gb-ship-form/dataAnalyse 数据分析
export const postDataAnalyse = (data: { good: string, year: string }) => {
    const url = basicIp + "/gb-ship-form/dataAnalyse";
    return newHttpService.postData(url, data);
}

export interface IDataAnalyseType {
    jzCars: number
    jzWeight: number
    monthName: string
}

//gb-ship-form/save 单次录入
export const postDataSave = (data: any) => {
    const url = basicIp + "/gb-ship-form/save";
    return newHttpService.postData(url, data);
}

// 获取导出配置
export interface IGbShipFormGetExportExcel {
    isSel: number;
    name: string; // 字段名称
    value: string; // 字段
}
export const getGbShipFormGetExportExcel = () => {
    const url = basicIp + "/gb-ship-form/getExportExcel";
    return newHttpService.getData(url);
}
// 设置导出设置
export const getGbShipFormSetExportExcel = (data: {exportExcel: string}) => {
    const url = basicIp + '/gb-ship-form/setExportExcel';
    return newHttpService.getData(url, data)
}